menuitem: Don't set menubar style class randomly
authorBenjamin Otte <otte@redhat.com>
Wed, 11 Apr 2012 13:02:00 +0000 (15:02 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 17 Apr 2012 06:59:23 +0000 (08:59 +0200)
a) We're not a menubar, you can match on the parent if you have to
b) It's not set while getting preferred sizes

gtk/gtkmenuitem.c

index 388c2a503859d85eda4a8f5e8f1271ff1e98c7b0..5a916da9f276b0bcf0d116551ed872e0d8818ea3 100644 (file)
@@ -1602,13 +1602,8 @@ gtk_menu_item_draw (GtkWidget *widget,
   child = gtk_bin_get_child (GTK_BIN (menu_item));
   parent = gtk_widget_get_parent (widget);
 
-  gtk_style_context_save (context);
-
   gtk_style_context_get_padding (context, state, &padding);
 
-  if (GTK_IS_MENU_BAR (parent))
-    gtk_style_context_add_class (context, GTK_STYLE_CLASS_MENUBAR);
-
   if (child && (state & GTK_STATE_FLAG_PRELIGHT))
     {
       gtk_render_background (context, cr, x, y, w, h);
@@ -1673,8 +1668,6 @@ gtk_menu_item_draw (GtkWidget *widget,
 
   GTK_WIDGET_CLASS (gtk_menu_item_parent_class)->draw (widget, cr);
 
-  gtk_style_context_restore (context);
-
   return FALSE;
 }